﻿using Bot.Domain.Entities;
using Comm100.Framework;
using Comm100.Framework.Domain.Specifications;
using System;
using System.Collections.Generic;
using System.Text;

namespace Bot.Domain.Specifications
{
    public class AgentAssistLearningQuestionFilterSpecification : BaseSpecification<AgentAssistLearningQuestion>
    {
        public AgentAssistLearningQuestionFilterSpecification(decimal minScore)
            : base(i => i.Score >= minScore)
        {

        }
        public AgentAssistLearningQuestionFilterSpecification(DateTime timeForm, DateTime timeTo)
            : base(i => i.CreatedTime >= timeForm && i.CreatedTime <= timeTo)
        {

        }

        public AgentAssistLearningQuestionFilterSpecification(DateTime timeForm, DateTime timeTo, string keyword)
            : base(i => i.CreatedTime >= timeForm && i.CreatedTime <= timeTo && i.Question.Contains(keyword, StringComparison.OrdinalIgnoreCase))
        {

        }

        public AgentAssistLearningQuestionFilterSpecification(DateTime timeForm, DateTime timeTo, decimal minScore)
            : base(i => i.CreatedTime >= timeForm && i.CreatedTime <= timeTo && i.Score >= minScore)
        {

        }

        public AgentAssistLearningQuestionFilterSpecification(DateTime timeForm, DateTime timeTo, string keyword, decimal minScore)
            : base(i => i.CreatedTime >= timeForm && i.CreatedTime <= timeTo && i.Score >= minScore && i.Question.Contains(keyword, StringComparison.OrdinalIgnoreCase))
        {

        }
        public void ApplyPaging(Paging paging)
        {
            base.ApplyPaging(paging.PageIndex, paging.PageSize);
        }
    }
}
